import { createRouter, createWebHistory } from 'vue-router';
import Login from './components/Login.vue';
import Home from './components/Home.vue';
import About from './components/About.vue';
import Task from './components/Task.vue'
import Statistics from './components/Statistics.vue'
import Clock from './components/Clock.vue'
const routes = [
  {path: '/',
    component: () => import('./components/MainLayout.vue'), // 主要布局
    children: [
      { path: 'login', component: Login },
      { path: '', redirect: 'login' }, // 默认重定向到/login
      { path: 'home', component: Home },
    ]
    },
  {
    path: '/home',
    name:"Home",
    component: Home,
  },
  {
    path: '/about',
    name:"About",
    component: About,
  },
  {
    path:'/task',
    name:"Task",
    component: Task,
  },
  {
    path: '/statistics',
    name:"Statistics",
    component: Statistics,
  },
  {
    path:'/clock',
    name:"Clock",
    component: Clock,
  },
  
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;

